<template>
	<view>
		<!-- <page-head :title="title"></page-head> -->
		<view class="uni-common-mt">
			<form @submit="formSubmit">
				<view class="uni-list">
					<view class="uni-list-cell">
						<view class="uni-list-cell-db">
							<view class="uni-label">检验日期</view>
						</view>
						<view class="uni-list-cell-db">
							<input class="uni-input" type="text" placeholder="必填" :value="detailData.inspDate"  name="inspDate"></input>
						</view>
					</view>
					<view class="uni-list-cell">
						<view class="uni-list-cell-db">
							<view class="uni-label">检验单号</view>
						</view>
						<view class="uni-list-cell-db">
							<view class="uni-input">{{detailData.inspNo}}</view>
						</view>
					</view>
				</view> 
				<view class="uni-list">
					<view class="uni-list-cell">
						<view class="uni-list-cell-db">
							<view class="uni-label">检验类型</view>
						</view>
						<view class="uni-list-cell-db">
							<input class="uni-input" type="text" placeholder="选填" :value="detailData.inspType_dictText" name="inspType_dictText"></input>
						</view>
					</view>
					<view class="uni-list-cell">
						<view class="uni-list-cell-db">
							<view class="uni-label">备注</view>
						</view>
						<view class="uni-list-cell-db">
							<input class="uni-input" type="text" placeholder="选填" :value="detailData.remark" name="remark"></input>
						</view>
					</view>
					
					<view class="uni-list-cell">
						<view class="uni-list-cell-db">
							<view class="uni-label">所属部门</view>
						</view>
						<view class="uni-list-cell-db">
							<view class="uni-input">{{detailData.sysOrgCode}}</view>
						</view>
					</view>
				</view>

				<view class="uni-padding-wrap" style="margin-top: 50upx;">
					<view class="uni-flex uni-row" >
						<button formType="submit" class="btn-save">保存</button>
						<button class="btn-del" @tap="delData">删除</button>
					</view>
				</view>
			</form>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex'
	export default {
		data() {
			return {
				detailData: [],
				// customerCode
			};
		},
		onLoad(e) {
			this.detailData = JSON.parse(e.item); 
			console.log(this.detailData)
		},
	// 	methods: {
	// 				formSubmit: function(e) {
	// 					console.log(e.detail.value.customerCode);
	// 					// return;
	// 					let myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
	// 	// 				if (!myreg.test(e.detail.value.customerCode)) {
	// 	// 					uni.showToast({
	// 	// 						icon: 'none',
	// 	// 						title: '请输入正确手机号码'
	// 	// 					});
	// 	// 					return;
	// 	// 				}
	// 					if (e.detail.value.customerDesc < 1) {
	// 						uni.showToast({
	// 							icon: 'none',
	// 							title: '请输入会员名称'
	// 						});
	// 						// return;
	// 					}
	// 					let url = this.$url + "zmdHuiYuanController/"+this.hydata.id;
	// 					let data = {
	// 						"customerCode": e.detail.value.customerCode,
	// 						"customerDesc": e.detail.value.customerDesc,
	// 						"mobile1": e.detail.value.customerCode,
	// 						"sex": e.detail.value.sex,
	// 						"birthday": e.detail.value.birthday,
	// 						"remark": e.detail.value.remark,
	// 						"id":this.hydata.id,
	// 						"sysCompanyCode": this.companyCode
	// 						// "updateName": $
	// 						// updateBy:
	// 					};
						
	// 					uni.request({
	// 						url: url,
	// 						method: "PUT",
	// 						data: data,
	// 						header: {
	// 							"X-AUTH-TOKEN": this.$token
	// 						},
	// 						success: res => {
	// 							console.log(JSON.stringify(res));
	// 							if (res.statusCode == "200" && res.data.respCode == "0") {
	// 								console.log("success");
	// 								}
	// 						},
	// 						fail: (err) => {
	// 							console.log(' fail'+ err);
	// 						},
	// 						complete: () => {
	// 						}
	// 					});
	// 					uni.navigateBack({
	// 						delta: 1
	// 					});
	// 				},
	// 				delData(){
	// 					uni.showModal({
	// 						title: '警告消息',
	// 						content: '你确认要删除当前会员吗？',
	// 						showCancel: true,
	// 						success: res => {
	// 							if (res.confirm) {
	// 	// 							console.log(this.hydata.id)
	// 	// 							return;
	// 								let url = this.$url + "zmdHuiYuanController/"+this.hydata.id;
	// 								console.log(url)
	// 								uni.request({
	// 									url: url,
	// 									method: "DELETE",
	// 									header: {
	// 										"X-AUTH-TOKEN": this.$token
	// 									},
	// 									success: (res) => {
	// 										console.log(JSON.stringify(res));
	// 										if (res.statusCode == "200" && res.data.respCode == "0") {
	// 											console.log("success")
	// 											}
	// 									},
	// 									fail: (err) => {
	// 										console.log(' fail', err);
	// 									},
	// 									complete: () => {
	// 									}
	// 								});
	// 								uni.navigateBack({
	// 									delta: 1
	// 								});
	// 							}
	// 						}
	// 					});
						
	// 				}
	// 			}
	 }
</script>

<style>
	.uni-list-cell:after {
		left: 20upx;
	}
	.uni-list-cell {
		height: 100upx;
	}
	.uni-input {
		text-align: right;
	}
	.uni-list {
		margin-bottom: 30upx;
	}
	.title {
		padding: 10px 0;
		width: 120px
	}
	
	.btn-save{
		background: #e3ae79;
		color: #FFFFFF;
		width: 150px;
		/* display: inline-block; */
		/* max-width: none; */
	}
	.btn-del{
		background: #fa6b4b;
		color: #FFFFFF;
		width: 150px;
		/* display: inline-block; */
	}
	/* .btn-bottom{
		display: flex;
		padding:10upx 0;
		flex-direction: row;
	} */
	.uni-list-cell{
		padding-right: 20upx;
	}
</style>
